<template>
  <van-sticky>
  <van-nav-bar :title="props.title" :left-arrow="props.left" :border="true" @click-left="onClickLeft" />
</van-sticky>
</template>

<script setup lang="ts">
const props = defineProps({
  title: {
    type: String,
    default: '首页',
    required: false // 是否必传
  },
  left: {
    type: Boolean,
    default: false,
    required: false // 是否必传
  }
})

// 返回
const onClickLeft = () => history.back()
</script>
<style lang="scss" scoped>
.van-nav-bar {
  background-color: #DC584D;
  color: #fff;
}
:deep(.van-nav-bar__title) {
  color: #fff;
}
:deep(.van-icon-arrow-left:before){
  color: #fff;

}
:deep(.van-nav-bar__title){
  // margin-left: 40px;
}
</style>